<template>
  <div class="container" v-if="shopInfo.rst">
    <div class="header">
      <div class="img">
        <div class="back" @click="$router.go(-1)"><i class="iconfont icon-fanhui"></i>返回</div>
        <img v-if="shopInfo.rst.scheme" :src="shopInfo.rst.scheme" class="bgc">
      </div>
      <div class="logo">
        <img :src="shopInfo.rst.image_path">
      </div>
    </div>

    <!-- 弹窗 -->
    <div class="title">
      <div @click="isShowModel = true">{{shopInfo.rst.name}}<i class="iconfont icon-sanjiaoright"></i></div>
    </div>
    <div>
      <Informodel :detail="shopInfo.rst" @close="close" v-if="isShowModel"></Informodel>
    </div>

    <!-- 优惠信息 -->
    <div class="rating">
      <ul>
        <li>
          评分{{shopInfo.rst.rating}}分
        </li>
        <li>
          月售{{shopInfo.rst.recent_order_num}}
        </li>
        <li>
          蜂鸟专送约{{shopInfo.rst.order_lead_time}}分钟
        </li>
      </ul>

      <Ddiscount :activities="shopInfo.rst.activities" />
      <div class="argement">
        公告:{{shopInfo.rst.promotion_info}}
      </div>
    </div>
    <div class="goods">
      <Navbar />
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </div>
  </div>
</template>
<script>
import Informodel from './Informodel.vue'
import Ddiscount from './Ddiscount.vue'
import Navbar from '../../components/shops/Navbar.vue'
export default {
  name: 'shop',
  data () {
    return {
      shopInfo: {},
      isShowModel: false
    }
  },
  created () {
    this.getData()
  },
  computed: {
  },
  methods: {
    getData () {
      this.$axios("/api/profile/batch_shop").then(res => {
        // console.log(res.data);
        this.shopInfo = res.data;
      });
    },
    /* 关闭弹窗 */
    close (e) {
      this.isShowModel = e
    }
  },
  components: {
    Informodel,
    Ddiscount,
    Navbar
  }
}
</script>
<style  scoped>
.img {
  position: relative;
}
.header .bgc {
  width: 100%;
  height: 2.2rem;
}
.header .logo {
  position: relative;
}
.header .logo img {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2rem;
}
.back {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  color: aliceblue;
  font-weight: 550;
}
.back i {
  font-size: 0.1rem;
  margin-right: 0.1rem;
  font-weight: 550;
}
.title {
  background-color: #fff;
  height: 1rem;
  line-height: 1rem;
  text-align: center;
  font-size: 0.45rem;
  font-weight: 550;
  padding-top: 0.4rem;
}
.rating {
  background-color: #fff;
}
.rating ul {
  display: flex;
  justify-content: center;
  color: rgb(116, 114, 114);
  font-size: 0.1rem;
}
.rating ul li {
  text-align: center;
  padding: 0 0.1rem;
}
.argement {
  padding: 0.2rem 1rem;
  text-align: left;
  color: rgb(116, 114, 114);
  font-size: 0.1rem;
}
</style>
